<script>
import store from './store.js'
export default {
  name: "Navbor",
  data(){
    return {
      content:"首页"
    }
  },
  mounted() {
    store.subscribe((value)=>{
      console.log("被触发了" + value)
      this.content = value
    })
  }
}

</script>

<template>
  <div>
    <button>返回</button>
    <span>{{content}}</span>
    <button>首页</button>
  </div>
</template>

<style scoped>
div{
  display: flex;
  width: 100%;
  justify-content: space-between;
  height: 50px;
  line-height: 50px;
  background: gray;
}
</style>